package com.example.qx.lianxra;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.example.qx.R;
import com.example.qx.database.data;
import com.example.qx.lei.zhangmi;

import java.sql.SQLException;

public class xiaoxiguanli extends AppCompatActivity {
 private Button but;
 private data data=new data();
 private zhangmi zhangmi= com.example.qx.lei.zhangmi.getInstance();

    public xiaoxiguanli() throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException {
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_xiaoxiguanli);
        Bundle bundle=getIntent().getExtras();
        but=findViewById(R.id.shanchuxiaoxijilu);
        but.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                try {
                    data.deletexiaoxijilu( zhangmi.getZhang(),bundle.getInt("duifangzhanghao"));
                } catch (SQLException e) {
                    throw new RuntimeException(e);
                }
            }
        });
    }
}